package uk.ac.ebi.bioinvindex.model.impl.xref;

import uk.ac.ebi.bioinvindex.model.impl.AnnotatableImpl;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * User: Nataliya Sklyar (nsklyar@ebi.ac.uk)
 * Date: Sep 19, 2007
 */
@Entity
@Table(name = "REFERENCE_SOURCE")
public class ReferenceSourceImpl extends AnnotatableImpl{

	private String name;

	private String url;

  protected ReferenceSourceImpl() {
    }

  public ReferenceSourceImpl(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		if (!super.equals(o)) return false;

		ReferenceSourceImpl that = (ReferenceSourceImpl) o;

		if (name != null ? !name.equals(that.name) : that.name != null) return false;
		if (url != null ? !url.equals(that.url) : that.url != null) return false;

		return true;
	}

	public int hashCode() {
		int result = super.hashCode();
		result = 31 * result + (name != null ? name.hashCode() : 0);
		result = 31 * result + (url != null ? url.hashCode() : 0);
		return result;
	}


	public String toString() {
		return "ReferenceSourceImpl{" +
				"acc='" + acc + "' " +
				"name='" + name + '\'' +
				", url='" + url + '\'' +
				'}';
	}
}
